package com.second.app.thread.fair_nofair_test;

/**
 * @author gyz
 * @date 2021/2/2 13:57
 */
public class RunFair {
    public static void main(String[] args) {
        Service service = new Service(true);

        Runnable runnable = () -> {
            System.out.println(Thread.currentThread().getName() + "：启动");
            service.serviceMethod();
        };
        Thread[] threadArray = new Thread[10];
        for (int i = 0; i < 10; i++) {
            threadArray[i] = new Thread(runnable);
        }
        for (int i = 0; i < 10; i++) {
            threadArray[i].start();
        }
    }
}
